/*    */ package btsm.servlet;
/*    */ 
/*    */ import btsm.bean.sqlBTSWork;
/*    */ import java.io.IOException;
/*    */ import javax.servlet.RequestDispatcher;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServlet;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ 
/*    */ public class ser_psect extends HttpServlet
/*    */ {
/*    */   public void init()
/*    */     throws ServletException
/*    */   {
/*    */   }
/*    */ 
/*    */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*    */     throws ServletException, IOException
/*    */   {
/* 20 */     sqlBTSWork PC = new sqlBTSWork("psect", "1");
/*    */ 
/* 22 */     String seraction = request.getParameter("seraction");
/* 23 */     String strsnid = request.getParameter("snid");
/* 24 */     String strToPage = request.getParameter("ToPage");
/* 25 */     if (strToPage == null) {
/* 26 */       strToPage = request.getParameter("tToPage");
/*    */     }
/*    */ 
/* 30 */     String filesnames = request.getParameter("filesnames");
/*    */ 
/* 32 */     String msg = "";
/* 33 */     String strRedURL = "common.jsp";
/*    */ 
/* 36 */     if (seraction.equalsIgnoreCase("serinsertsimple"))
/*    */     {
/* 38 */       if (PC.insertPsect(""))
/* 39 */         msg = "新建管井段成功";
/*    */       else
/* 41 */         msg = "新建管井段失败";
/*    */     }
/* 43 */     else if (seraction.equalsIgnoreCase("sermodp")) {
/* 44 */       request.setAttribute("snid", strsnid);
/* 45 */       if (strToPage == null)
/* 46 */         strToPage = "1";
/* 47 */       strRedURL = "nnmd_psect.jsp?ToPage=" + strToPage;
/* 48 */     } else if (seraction.equals("serdel")) {
/* 49 */       if (PC.delbyid(strsnid))
/* 50 */         msg = "管井段信息删除成功";
/*    */       else
/* 52 */         msg = "管井段信息删除失败";
/* 53 */       strsnid = "";
/* 54 */     } else if (seraction.equals("sermod")) {
/* 55 */       String[] fieldxg = request.getParameterValues("T1");
/* 56 */       if (PC.mdByID(fieldxg, strsnid))
/* 57 */         msg = "管井段信息修改成功";
/*    */       else
/* 59 */         msg = "管井段信息修改失败";
/*    */     }
/* 61 */     PC.dbConClose();
/* 62 */     String filesnamesmd = "ser_psect?seraction=sermodp&filesnames=" + filesnames + "&snid=" + strsnid + "&ToPage=" + strToPage;
/* 63 */     request.setAttribute("filesnames", filesnamesmd);
/* 64 */     request.setAttribute("msg", msg);
/* 65 */     RequestDispatcher btsm = request.getRequestDispatcher(strRedURL);
/* 66 */     btsm.forward(request, response);
/*    */   }
/*    */ 
/*    */   public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
/*    */   {
/* 71 */     doGet(request, response);
/*    */   }
/*    */ 
/*    */   public void destroy()
/*    */   {
/*    */   }
/*    */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_psect
 * JD-Core Version:    0.6.2
 */